<template>
  <div class="container">
    <div class="line">
      <div class="title">借款类型</div>
      <div class="value">{{bizAccountBill.loanType.name}}</div>
    </div>
    <div @click="selectExpenseType" class="line box box-ac">
      <div class="box-f1">
        <div class="title">借款用途<span class="tc-red">*</span></div>
        <div class="value">{{bizAccountBill.expenseName}}&nbsp;</div>
      </div>
      <div v-if="bizAccountBill.loanType.type === 40" class="icon icon-arrow-right"></div>
    </div>
    <div class="line">
      <div class="title">借款金额<span class="tc-red">*</span></div>
      <div class="value box box-ac">
        <div class="tc-000">¥&nbsp;</div>
        <input v-limit-money="{max: bizAccountBill.limitMoney}" v-model="bizAccountBill.amount" class="box-f1" type="number">
        <div class="icon-edit icon"></div>
      </div>
    </div>
    <div class="line">
      <div class="title box box-ac">
        <div class="box-f1">说明<span class="tc-red">*</span></div>
        <div class="icon-edit icon"></div>
      </div>
      <div class="vulue box">
        <textarea v-model="bizAccountBill.purpose" placeholder="请填写借款说明" class="box box-f1" name=""></textarea>
      </div>
    </div>
    <div @click="next()" class="btn-bot">第三步 确认收款信息</div>
  </div>
</template>

<script>
import { mapState } from 'vuex'
export default {
  name: 'jiekuanStep2',
  computed: {
    ...mapState(['userNum', 'bizAccountBill'])
  },
  data () {
    return {
    }
  },
  methods: {
    selectExpenseType () {
      if (this.bizAccountBill.loanType.type !== 40) return
      this.$router.push({
        path: '/jiekuanExpenseType'
      })
    },
    next () {
      if (!this.bizAccountBill.expenseNum) {
        this.$tools.openToast({
          msg: '请选择借款用途',
          duration: 2000
        })
        return
      }
      if (!this.bizAccountBill.amount) {
        this.$tools.openToast({
          msg: '请填写借款金额',
          duration: 2000
        })
        return
      }
      if (!this.bizAccountBill.purpose) {
        this.$tools.openToast({
          msg: '请填写借款说明',
          duration: 2000
        })
        return
      }
      this.$router.push('/jiekuanStep3')
    }
  }
}
</script>

<style lang="scss" scoped>
@import '../assets/css/config';
@import '../assets/css/mixins';
.line{
  padding:.3rem;
  background-color:#FFF;
  border-bottom:1px solid #ddd;
  &:nth-of-type(1) {
    margin-top:.35rem;
  }
  .title{
    font-size:.3rem;
  }
  .value{
    margin-top:.15rem;
    color:#888;
    font-size:.34rem;
    // max-width:6rem;
  }
  textarea{
    margin-top:.25rem;
    padding:.15rem;
    border:1px solid #666;
    border-radius:.15rem;
    font-size:.3rem;
    height:1.8rem;
    margin-bottom:.25rem;
  }
}
.btn-bot{
  @include btn(100%, 1rem, .36rem);
  position: absolute;
  bottom:0;
  left:0;
}
</style>
